home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / C / ASAP / nvinfo_.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-09-09  |  1.7 KB  |  50 lines

  1. /*****************************************************************************
  2.  *                                                                           *
  3.  * ASAP - Amiga Software Authoring Platform                                  *
  4.  *                                                                           *
  5.  * Written by Laurie Perrin                                                  *
  6.  *                                                                           *
  7.  * ANVInfo wrapper class                                                     *
  8.  *                                                                           *
  9.  *****************************************************************************/
  10.  
  11. #ifndef ASAP_ANVInfo_H
  12. #define ASAP_ANVInfo_H
  13.  
  14. #include <New.h>
  15.  
  16. extern "C"
  17. {
  18.  #include <Proto/Nonvolatile.h>
  19. }
  20.  
  21. class ANVInfo : public NVInfo
  22. {
  23.  public:
  24.  inline void FreeNVData();
  25.  inline void operator delete(void *);
  26.  inline static ANVInfo * GetNVInfo(long killRequesters = 1);
  27.  inline void * operator new(size_t, BOOL killRequesters = 1);
  28. };
  29. //----------------------------------------------------------------------------
  30. void ANVInfo::FreeNVData ()
  31. {
  32.  ::FreeNVData((APTR) this);
  33. }
  34. //----------------------------------------------------------------------------
  35. void ANVInfo::operator delete(void *data)
  36. {
  37.  ((ANVInfo *) data)->FreeNVData();
  38. }
  39. //----------------------------------------------------------------------------
  40. ANVInfo * ANVInfo::GetNVInfo (long killRequesters)
  41. {
  42.  return (ANVInfo *) ::GetNVInfo(killRequesters);
  43. }
  44. //----------------------------------------------------------------------------
  45. void * ANVInfo::operator new (size_t, BOOL killRequesters)
  46. {
  47.  return ANVInfo::GetNVInfo(killRequesters);
  48. }
  49.  
  50. #endif